import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// 按需导入组件
import './pugins/element'
import 'element-ui/lib/theme-chalk/index.css'
// 导入全局样式表
import './assets/css/global.css'
// 导入iconfont
import './assets/icon/iconfont.css'
// 导入axios
import axios from 'axios'
// 引入echarts
import echarts from 'echarts'

axios.defaults.baseURL = 'http://localhost:8082'
axios.interceptors.request.use(config => {
  // console.log(config)
  config.headers.Authorization = window.sessionStorage.getItem('token')
  // console.log(config.headers.Authorization)
  return config
})
Vue.prototype.$http = axios
Vue.config.productionTip = false
// 注入组件库
// Vue.use(ElementUI)
// echarts
Vue.prototype.$echarts = echarts

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
